﻿Public Class NhomNguoiSuDung

    'Private Sub NhomNguoiSuDung_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    '    Me.Hide()
    '    Me.Parent = Nothing
    'End Sub

    Private Sub Form1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = (e.Control And Keys.N) Then
            Me.NhomnguoidungIUltraGrid.getTaoMoi()
        End If
        If e.KeyCode = (e.Control And Keys.S) Then
            Me.NhomnguoidungIUltraGrid.getLuu()
        End If
        If e.KeyCode = (e.Control And Keys.D) Then
            Me.NhomnguoidungIUltraGrid.getXoa()
        End If
        If e.KeyCode = (e.Control And Keys.R) Then
            Me.NhomnguoidungIUltraGrid.getRefresh()
        End If
        If e.KeyCode = (e.Control And Keys.Q) Then
            Me.Dispose()
            Me.Close()
        End If
    End Sub

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Me.NhomnguoidungTableAdapter.Fill(Me.ErpharmaDataSet.nhomnguoidung)
        Me.NhomnguoidungIUltraGrid.setDoiTuongXuLyDuLieu(Me.ErpharmaDataSet.nhomnguoidung, Me.NhomnguoidungBindingSource, Me.NhomnguoidungTableAdapter, Me.ErpharmaDataSet)
        Me.NhomnguoidungIUltraGrid.setChoPhepLuuXongKhongThemDong()
        Me.NhomnguoidungIUltraGrid.setGiaoDienVua()
        Me.NhomnguoidungIUltraGrid.setTimKiemTrenCotUltraGrid()
        Me.NhomnguoidungIUltraGrid.setChoPhepMenuStrip()
    End Sub

    Private Sub btnTaoMoi_Click(sender As System.Object, e As System.EventArgs) Handles btnTaoMoi.Click
        Me.NhomnguoidungIUltraGrid.getTaoMoi()
    End Sub

    Private Sub btnLuu_Click(sender As System.Object, e As System.EventArgs) Handles btnLuu.Click
        Me.NhomnguoidungIUltraGrid.getLuu()
    End Sub

    Private Sub btnXoa_Click(sender As System.Object, e As System.EventArgs) Handles btnXoa.Click
        Me.NhomnguoidungIUltraGrid.getXoa()
    End Sub

    Private Sub btnLamTuoi_Click(sender As System.Object, e As System.EventArgs) Handles btnLamTuoi.Click
        Me.NhomnguoidungIUltraGrid.getRefresh()
    End Sub

    Private Sub btnThoat_Click(sender As System.Object, e As System.EventArgs) Handles btnThoat.Click
        Me.Dispose()
        Me.Close()
    End Sub
End Class
